package Control;

import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

import Entity.MsgPackage;
import GUI.ExaminationStageGui;
import GUI.ScreenManager;

public class ExaminationStageControl {
	private ExaminationStageGui exam_stage_gui;
	private MsgPackage exam;
	private String[] data;
	
	private ExaminationStageControl(){
		exam_stage_gui=new ExaminationStageGui();
		exam= new MsgPackage();
		data= new String [2];
		
	}

	public ExaminationStageGui getExaminationGui() {
		 return exam_stage_gui ;
	}
	
	public void reqANDstageEntered(String ReqNum){
		data[0]=ReqNum;
	}
	

	public void examination_Submit_pressed() {
		String x= (String)exam_stage_gui.getDecision().getSelectedItem();
		if(x==null){
			JOptionPane.showMessageDialog(null, "Not all the fileds all the fill", "ERROR", JOptionPane.ERROR_MESSAGE);
		}
		else{
			data[1]=(String)exam_stage_gui.getDecision().getSelectedItem();
			exam.setObject(data);
			exam.setOp_code(OP_CODE.EXAMINATION_STAGE);
			ScreenManager.getClient().accept(exam);
			JOptionPane.showMessageDialog(null, "Your stage was updated successfully!!", "", JOptionPane.INFORMATION_MESSAGE);

		}
		
	}

	
}
